Write a custom CUDA kernel to optimize `Symmetric Cross Entropy (SCE) Loss`.

Formula: Loss = alpha * CE + beta * RCE
CE = -log(Pt)
RCE = -sum(P * log(clip(OneHot(target), min=eps)))

Problem Analysis:
1. Memory Intensity: The standard implementation materializes full `(N, C)` tensors for Softmax probabilities, One-Hot targets, and the element-wise multiplication for RCE.
2. Bandwidth Waste: RCE involves a sum reduction over the class dimension after element-wise operations, which is bandwidth heavy.

Optimization Strategy: Fused Softmax & Simplified Math

1. Mathematical Simplification:
   For one-hot targets, the RCE term simplifies significantly:
   sum(P * log(Q_clamped)) = Pt * log(1) + sum_{k!=t} (Pk * log(eps))
   Since log(1) = 0, and sum_{k!=t} Pk = (1 - Pt):
   RCE = -log(eps) * (1 - Pt).
   
   Thus, SCE = -alpha * log(Pt) - beta * log(eps) * (1 - Pt).
   The loss depends *only* on Pt.

2. One-Pass Kernel:
   The kernel fuses Softmax normalization (Max + SumExp) and the loss calculation into a single pass per row.

3. Vectorized Loading:
   Use `float4` to load logits from global memory efficiently.

4. In-Register Reduction:
   Compute Max and SumExp using warp/block reductions in shared memory without writing intermediate results.

5. Final Computation:
   Thread 0 computes `Pt`, applies the simplified formula, and writes the scalar loss.
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn
import torch.nn.functional as F

BATCH_SIZE = 2048
NUM_CLASSES = 4096
SHAPE = (BATCH_SIZE, NUM_CLASSES)

# SCE 参数
ALPHA = 0.1
BETA = 1.0
EPSILON = 1e-7
REDUCTION = 'none'

class SCELoss(nn.Module):
    """
    Symmetric Cross Entropy Loss (ICCV 2019)
    L = alpha * CE + beta * RCE
    """
    def __init__(self, alpha=0.1, beta=1.0, epsilon=1e-7, reduction='mean'):
        super(SCELoss, self).__init__()
        self.alpha = alpha
        self.beta = beta
        self.epsilon = epsilon
        self.reduction = reduction

    def forward(self, logits: torch.Tensor, targets: torch.Tensor) -> torch.Tensor:
        # logits: (N, C)
        # targets: (N)
        ce = F.cross_entropy(logits, targets, reduction='none')
        
        pred = F.softmax(logits, dim=1)
        
        one_hot = torch.zeros_like(logits)
        one_hot.scatter_(1, targets.view(-1, 1), 1.0)
        
        one_hot = torch.clamp(one_hot, min=self.epsilon, max=1.0)
        
        rce = -torch.sum(pred * torch.log(one_hot), dim=1)
        
        loss = self.alpha * ce + self.beta * rce
        
        if self.reduction == 'mean':
            return loss.mean()
        elif self.reduction == 'sum':
            return loss.sum()
        return loss

class Model(nn.Module):
    def __init__(self, alpha=0.1, beta=1.0, epsilon=1e-7, reduction='none'):
        super(Model, self).__init__()
        self.loss_fn = SCELoss(alpha=alpha, beta=beta, epsilon=epsilon, reduction=reduction)
    
    def forward(self, logits, targets):
        return self.loss_fn(logits, targets)

def get_inputs():
    logits = torch.randn(SHAPE, dtype=torch.float32)
    targets = torch.randint(0, NUM_CLASSES, (BATCH_SIZE,), dtype=torch.long)
    return [logits.contiguous(), targets.contiguous()]

def get_init_inputs():
    return [ALPHA, BETA, EPSILON, REDUCTION]